package com.crm.service.impl;

import javax.transaction.Transactional;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.crm.dao.FinanceZpIncomeMapper;
import com.crm.model.FinanceZpIncome;
import com.crm.service.FinanceZpIncomeService;
import com.crm.util.UUIDUtil;

@Service
public class FinanceZpIncomeServiceImpl extends BaseServiceImpl<FinanceZpIncome> implements FinanceZpIncomeService{
	
	@Autowired
	private FinanceZpIncomeMapper incomeMapper;
	
	@Transactional
	@Override
	public int insert(FinanceZpIncome record) {
		
		String uuid = UUIDUtil.getUUID();
		record.setZpIncomeId(uuid);
		return super.insert(record);
	}

	@Override
	public void deleteById(String zpIncomeId) {
		
		incomeMapper.deleteById(zpIncomeId);
	}

	@Override
	public FinanceZpIncome getTotalIncome(FinanceZpIncome t) {
		
		return incomeMapper.getTotalIncome(t);
	}

}
